home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOOM Companion (Alt)
/
DOOM Companion CD-ROM - iso.7z
/
DOOM Companion CD-ROM.iso
/
other
/
doom_ps
/
wad.h
< prev
Wrap
C/C++ Source or Header
|
1994-03-08
|
2KB
|
100 lines
/*
* Doom PostScript map generator.
* Copyright James Bonfield, 3/3/94
*/
#ifndef _WAD_H_
#define _WAD_H_
typedef int int4;
typedef short int2;
struct wad_header {
int4 magic;
int4 dir_size;
int4 dir_off;
};
struct directory {
int4 start;
int4 length;
char name[8];
};
typedef struct linedef_ {
int2 from_vertex;
int2 to_vertex;
int2 attrib;
int2 type;
int2 trigger;
int2 sidedef1;
int2 sidedef2;
} linedef;
/* linedef attrib bits */
#define LI_IMPASS 0x01
#define LI_SECRET 0x20
typedef struct vertex_ {
int2 x;
int2 y;
} vertex;
typedef struct sidedef_ {
int2 x;
int2 y;
char wall_above[8];
char wall_below[8];
char wall_part[8];
int2 sector;
} sidedef;
typedef struct ssector_ {
int2 num;
int2 seg;
} ssector;
typedef struct sector_ {
int2 bot_pos;
int2 top_pos;
char bot_texture[8];
char top_texture[8];
int2 brightness;
int2 special;
int2 trigger;
} sector;
typedef struct thing_ {
int2 x;
int2 y;
int2 angle;
int2 type;
int2 attrib;
} thing;
/* thing 'type' bits */
#define TH_SKILL1 0x01
#define TH_SKILL2 0x01
#define TH_SKILL3 0x02
#define TH_SKILL4 0x04
#define TH_MULTI 0x08
typedef int2 blockmap;
extern struct directory *open_wad(char *file, int *fd, int *size);
extern int get_index(struct directory *d, int size, char *name, int st);
extern linedef *read_linedefs(int fd, struct directory *d, int size,
int start, int *num);
extern vertex *read_vertexes(int fd, struct directory *d, int size,
int start, int *num);
extern blockmap *read_blockmap(int fd, struct directory *d, int size,
int start, int *num);
extern sidedef *read_sidedefs(int fd, struct directory *d, int size,
int start, int *num);
extern sector *read_sectors(int fd, struct directory *d, int size,
int start, int *num);
extern thing *read_things(int fd, struct directory *d, int size, int start,
int *num);
#endif